package com.xframe.xdal.core.annotation;

import lombok.Getter;

public enum AttrType {
    LONG("LONG"),
    TIME("TIME"),
    BOOLEAN("BOOLEAN"),
    FLOAT("FLOAT"),
    DECIMAL("DECIMAL"),
    INTEGER("INTEGER"),
    STRING("STRING"),
    DATE("DATE"),
    DOUBLE("DOUBLE");
    @Getter
    private String code;

    AttrType(String code) {
        this.code = code;
    }

    public static AttrType getByCode(String code) {
        for (AttrType e: AttrType.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

}
